import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    //String[] arr = new String[]{};
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String a = in.nextLine();
            String b = in.nextLine();
            a = a.toUpperCase();
            b = b.toUpperCase();
            Set<Character> set = new HashSet<>();
            int aLen = a.length();
            for(int i = 0;i < aLen ;i++){
                char c = a.charAt(i);
                set.add(c);
            }
            int bLen =  b.length();
            int ret = 0;
            Set<Character> bSet = new HashSet<>();
            for(int i = 0; i< bLen;i++){
                char c = b.charAt(i);
                if(!set.contains(c) && !bSet.contains(c)){
                    bSet.add(c);
                }

            }
            for(char s : bSet){
                System.out.print(s);
            }
            System.out.println();
        }
    }
}
